package com.yfbao.horizon.skywalking.custom.service;

import com.yfbao.horizon.skywalking.service.NormalServcie;
import com.yfbao.horizon.skywalking.service.TestParentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Slf4j
@Primary
@Component
public class TestChildService extends TestParentService {

    @Autowired
    private NormalServcie normalServcie;

    @Override
    public String testPubMethod3(String param){
        if(param.length()>3){
            return super.testPubMethod3(param);
        }
        log.info("child pub method3");
        String s = normalServcie.testMethod();
        return s+"_"+param;
    }

    @Override
    public List<Long> testPubMethod2(String param){
        log.info("child pub method2");
        List<Long> list = new ArrayList<>();
        list.add(-1111111222L);
        return list;
    }
}
